package com.lifeng.zk.zkclient.watch;

import org.I0Itec.zkclient.ZkClient;

/**
 * Created by lifeng on 2018/6/14.
 */
public class Main {
    private static String serverUrl = "127.0.0.1:2181";

    public static void main(String[] args) throws Exception{
        ZkClient zkClient = new ZkClient(serverUrl);
        System.out.println("zkclient 链接成功");
        zkClient.createPersistent("/config",true);
        zkClient.writeData("/config","127.0.0.1");
        zkClient.close();
    }
}
